<template>
  <div>
    <van-nav-bar title="购物车" />
      <van-swipe-cell :before-close="beforeClose">
        <van-card
          num="2"
          price="2.00"
          desc="描述信息"
          title="商品标题"
          class="goods-card"
          thumb="https://img01.yzcdn.cn/vant/cat.jpeg"
        />
        <template #right>
          <van-button square type="danger" text="删除" style="height: 100%" />
        </template>
      </van-swipe-cell>
      <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit" style="bottom:50px">
      </van-submit-bar>

    <tabbar></tabbar>
  </div>
</template>

<script>
import { Dialog } from "vant";
import Tabbar from "../components/Tabbar.vue";
export default {
  components: { Tabbar },
  data() {
    return {
      result: [],
      checked:false,
    };
  },
  methods: {
      onClickEditAddress(){},
      onSubmit(){},
    checkAll(data) {
        console.log(data);
    //   this.$refs.checkboxGroup.toggleAll();
    },
    // toggleAll() {
    //   this.$refs.checkboxGroup.toggleAll();
    // },
    // position 为关闭时点击的位置
    // instance 为对应的 SwipeCell 实例
    beforeClose({ position, instance }) {
      switch (position) {
        case "left":
        case "cell":
        case "outside":
          instance.close();
          break;
        case "right":
          Dialog.confirm({
            message: "确定删除吗？",
          }).then(() => {
            instance.close();
          });
          break;
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.checkbox {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}
</style>